package excise;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;

/**
 * @author CoderXshuai
 */
public class MainTest {
    //创建定时周期性的任务执行线程池，注意线程池类型是ScheduledExecutorService
    static ExecutorService pool = Executors.newCachedThreadPool();

    public static void main(String[] args) {
        int count = 5;
        SellTicket sellTicket = new SellTicket(count);
        pool.execute(sellTicket);
        pool.execute(sellTicket);
        pool.execute(sellTicket);
        System.out.println(sellTicket.getID());
    }
}

